package com.liyao.storehouse.api.service.impl;

import com.liyao.storehouse.api.entity.Client;
import com.liyao.storehouse.api.service.IClientService;
import com.liyao.storehouse.api.utill.RSAUtils;
import com.liyao.storehouse.api.utill.SystemConfig;
import com.liyao.storehouse.dao.ClientDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @program: storehouse
 * @description:
 * @author: liu yan
 * @create: 2024-12-04 15:59
 */
@Service
public class IClientServiceImpl implements IClientService {
    @Resource
    ClientDao dao;
    @Resource
    protected RSAUtils rsa;
    @Override
    public Client getClientMes(Client client) {
        return dao.getClientMes(client);
    }

    @Override
    public String jiemi(String data) {
        System.out.println(data);
        return rsa.decrypt(data.replaceAll(" ",""), SystemConfig.RSA_PRIVATE_KEY);
    }
}
